<?php if (!defined('THINK_PATH')) exit();?><div class="row">
    <div class="top">资产部>电催任务</div>
    <div class="content applylist">
        <div class="box">
            <h1>电催任务列表</h1>
            <div class="list-block">
                <div class="row">
                    <!-- <a href="<?php echo U('Bankrule/add');?>"><button class="addcus"><span></span>添加规则</button></a> -->
                </div>
                <div class="row">
                    <table class="list">
                        <tr>
                            <th>姓名</th> <th>身份证</th> <th>银行卡号</th> <th>逾期月份</th> <th>逾期金额</th><th>状态</th><th>操作</th>
                        </tr>
                        <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$_overdue): $mod = ($i % 2 );++$i;?><tr>
                                <td><?php echo ($_overdue["id"]); ?></td>
                                <td><?php echo ($_overdue["indenty_no"]); ?></td>
                                <td><?php echo ($_overdue["bank_card"]); ?></td>
                                <td><?php echo ($_overdue["overdue_month"]); ?></td>
                                <td><?php echo ($_overdue["overdue_money"]); ?></td>
                                <td>
                                    <?php switch($_overdue["task_status"]): case "0": ?>未催回<?php break;?>
                                        <?php case "1": ?>已催回<?php break;?>
                                        <?php case "2": ?>已代偿<?php break; endswitch;?>
                                </td>
                                <td>
                                    <a href="<?php echo U('Task/feedback?overdue_id='.$_overdue['id']);?>">填写反馈</a>
                                    <a class="" href="<?php echo U('Apply/detail_info?user_id='.$_overdue['user_id']);?>">查看资料</a>
                                </td>
                            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                    </table>
                </div>
                <?php echo ($page); ?>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    // 传递overdue-id
    $('.point-task').click(function(){
        var overdueId = $(this).attr('data-id');
        $('#overdue-id').val(overdueId);
    });

    // 提交反馈信息
    $('#sub-feedback').click(function(){
        var overdueId   = $('#overdue-id').val();
        var executeType = $('#execute-type').val();
        var feedback    = $('#feedback').val();

        $.ajax({
           type: "POST",
           url: "/index.php?s=/Admin/Task/telbak",
           data: {
                overdue_id:overdueId,
                execute_type:executeType,
                feedback:feedback
            },
           success: function(msg){
                console.log(msg);
                if (msg > 1) {
                    alert('添加反馈成功');
                    window.location.reload()
                    return false;
                }else{
                    msg = $.parseJSON(msg);
                    alert(msg.message);
                }
           }
        });

        $(this).attr('data-dismiss','modal');
    });
</script>